\section{Examples}
\label{sec:examples}

An illustration of the different kinds of constraints applicable is shown in figure \ref{fig:Examples}. The experiments are all executed with parameters $N=8$, $D=1200$ and $m=20$, except for the experiment with 3 points suspended, where $N=6$. 
\begin{itemize}
\item Figure \ref{fig:example_3} shows the cloth suspended by 4 points, a linear equality constraint. The code for this experiment is provided in \emph{bfgs\_cloth\_4}.
\item Figure \ref{fig:example_4} shows the cloth suspended by 3 points, also a linear equality constraint. The code for this experiment is provided in \emph{bfgs\_cloth\_3}.
\item Figure \ref{fig:example_plane} shows the cloth suspended by 4 points, and with a linear inequality constraint representing a plane. The code for this experiment is provided in \emph{bfgs\_ineq\_plane}.
\item Figure \ref{fig:example_globe} shows the cloth suspended by 4 points, and with a nonlinear inequality constraint representing a globe. The code for this experiment is provided in \emph{bfgs\_ineq\_globe}.
\end{itemize}
The solutions are shown by plotting the individual structural and shear springs. The color of the springs indicate their deviation from the restlength $L$, red indicating a stretched spring, green indicating a spring close to its restlength. This information could for example be used to reinforce the cloth in areas were it experiences a lot of stress.

An example illustrating the importance of initial values is shown in figure \ref{fig:initial_values}. The optimization problem shown is that of a cloth suspended by two points, with a sphere right beneath that acts as an inequality constraint. In figure \ref{fig:bol1} and \ref{fig:bol2} the final position as well as the initial values are shown. It is clear that the cloth will rest on the side of the globe where it started. This illustrates how the inequality constraints can make the problem non-convex. It now has different local minima, and the minimum reached by the routine depends on the initial values.


The importance of the presence of shear springs and bend springs in addition to the structural springs is shown in figure \ref{fig:differentSprings}. The left image side shows the cloth with all spring structures i.e. structural springs, bend springs and shear springs. The right image shows the same setup but this time the cloth only contains structural springs. The more complex cloth displays much more realistic behaviour than the simple cloth. This figure shows that the way the cloth is modelled has a profound effect on the equilibrium position of the discrete points.

